package com.woniu.cq.medical.controller;


import com.woniu.cq.medical.common.Result;
import com.woniu.cq.medical.entity.ProjectInfo;
import com.woniu.cq.medical.service.ProjectInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2020-09-08
 */
@RestController
@RequestMapping("/medical/project-info")
@CrossOrigin("*")//解决跨域问题
@Slf4j
public class ProjectInfoController {
    @Autowired
    private ProjectInfoService projectInfoService;


    /**
     * 根据大的检查类别的ID查询出小的检查类别
     * @param id
     * @return 小的检查类别的集合
     */
    @RequestMapping("selectProjectInfoByTypeId")
    public Result selectProjectInfoByTypeId(String id){
        int i = Integer.parseInt(id);
        List<ProjectInfo> projectInfos = projectInfoService.selectProjectInfoByTypeId(i);
        return Result.success(projectInfos);
    }

}

